//
//  VECreatDTSummaryTableViewCell.m
//  VEMoneyPorject
//
//  Created by BlueWind on 2018/9/24.
//  Copyright © 2018年 陈建. All rights reserved.
//

#import "VECreatDTSummaryTableViewCell.h"

@implementation VECreatDTSummaryTableViewCell



/** 返回循环利用的cell */
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self= [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self loadDefaultSetting];
    }
    return self;
}

/** 加载默认UI元素和需要的数据 */
- (void)loadDefaultSetting {
    
    self.inputTextView = [BRPlaceholderTextView new];
    [self.contentView addSubview:self.inputTextView];
    [self.inputTextView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(UIEdgeInsetsMake(GAP8, GAP15, 42, GAP15));
    }];
    self.inputTextView.placeholder = @"请输入文字...";
    
    UIButton *button = [UIButton new];
    self.button = button;
    [self.contentView addSubview:button];
    [button mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.inputTextView.mas_bottom).offset(GAP8);
        make.left.equalTo(self.inputTextView);
        make.height.mas_equalTo(30);
    }];
    button.contentEdgeInsets = UIEdgeInsetsMake(5, 8, 5, 8);
    [button setTitle:@"选择社群" forState:(UIControlStateNormal)];
    [button setTitleColor:[UIColor orangeColor] forState:(UIControlStateNormal)];
    button.titleLabel.font = kFont(14);
    [button setLayerCornerRadius:15];
    [button layerBorderWithWidth:1 borderColor:[UIColor orangeColor]];
    
    [button addTarget:self action:@selector(click) forControlEvents:(UIControlEventTouchUpInside)];
    
}

- (void)click {
    
    if (_seletedAssion) {
        _seletedAssion();
    }
    
}

@end
